home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / demo / prepare.sit / Prepare() Demo Issue / Prepare() / Manual Pages / BProfileDoc.bin / BProfileDoc
Encoding:
Text File  |  1990-01-01  |  2.6 KB  |  40 lines  |  [TEXT/Brow]

  1.  
  2. BProfileDoc
  3. (Profiler)
  4.  
  5. Introduction
  6.  
  7. BProfileDoc controls the user interface for the Profiler and Tracer.  When initialized, it opens a window containing a BProfilePane and a BProfileList.  This document can save into a file, but does not know how to open a file.  This document should be created in your Application's initialization method.
  8.  
  9. Heritage
  10.  
  11. Superclass    CDocument
  12. Subclasses    None
  13.  
  14. Using BProfileDoc
  15.  
  16. Include the classes BProfileDoc, BProfilePane, BProfileChore, BProfileListDoc, and BProfileList in your project.  If you are using the VIA timer, include the file VIA_timer.c also.  Compile these files with profiling OFF (we recommend building these files in a separate project and including that project file in your own project).  You will need to have many Honors Class objects in the project also, but all the other files can be compiled with profiling on.
  17.  
  18. Somewhere in your Application's initialization you should insert some code like:
  19.  
  20.     {
  21.     BProfileDoc * thePrDocument;
  22.  
  23.     thePrDocument = new(BProfileDoc);
  24.     thePrDocument->IProfileDoc(this, TRUE, 500, 200, 2000);
  25.     thePrDocument->NewFile();
  26.     }
  27.  
  28. The parameters of IProfileDoc determine the supervisor of the document (which should always be the Application), whether the profiler text can be printed, the maximum number of functions to profile, the maximum stack depth for profiling (which should be <=200), and the size of the trace buffer.
  29.  
  30. This code will cause the Profiler to open its window and install its menu when your program is run.  The Profiler does not require any other modifications to your source code.
  31.  
  32. The profiler avoids interaction with other parts of the system by writing into the text Pane via a BProfileChore.  This chore is executed once every 1/2 second, and unloads 100 lines of text accumulated in the trace queue.  If you turn on trace for Chore_Perform, you will see it occurring once every 1/2 second.  Since the Chore is assigned at initialization time, and nothing within the core of the profiler moves or allocates memory, this system allows the profiler to use an object-oriented interface (which certainly moves and allocates memory) to display the output of an extremely low-level task.
  33.  
  34. You can throw away trace that has not been unloaded by the Chore by selecting "Throw Away Trace" from the Profile menu.
  35.  
  36. Instance Variables, Methods, Functions, Resources, and Summary
  37.  
  38. This demo issue of Prepare() does not include the detailed information on each instance variable, method, function, and resource defined in this file.  Subscribers receive complete source and manual pages for every class in each issue.
  39.  
  40.